var ns;
app = new Vue({
    el: '#app',
    data: {
        ProjectList: [],//公司列表---总公司和子公司
        CompanyID: 0,//公司ID
        FullName: '',//公司名称
        IsSearch:false,//是否是搜索状态 false不是 true是
        defaultImg:"../image/default.png",//默认头像
        isshow: false,
        childlist: [],
        currentchosenlist: [],//部门列表
        form: {
            keywords: ''
        }
    },
    methods: {
        get_data: function() {
            var that = this;
            that.form.keywords = that.form.keywords.trim();
            ns.post({
                keywords: that.form.keywords,
                action: 'getcompanyorganize',
                companyID: that.CompanyID
            }, function(succeed, data, err) {
                that.IsSearch = !that.form.keywords || that.form.keywords.length===0 ? false : true;
                if (succeed) {
                    let resultData = data.data;
                    if(data.status && resultData){
                        if(resultData.list && resultData.list instanceof Array){
                            that.currentchosenlist = resultData.list;
                        }
                    };
                } else {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            });
        },

    }
});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    ns.init_search();
    app.get_project();
};
